package ai.people.platform.system.controller;

import ai.people.netmon.framework.domain.system.entity.NmSystemRoleUser;
import ai.people.netmon.framework.model.response.Result;
import ai.people.netmon.framework.utils.ResultUtil;
import ai.people.platform.system.service.SysRoleUserService;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 角色用户接口
 *
 * @author zhenglin
 * @since 2022/3/22
 */
@Validated
@RestController
@RequiredArgsConstructor
@RequestMapping("/roleUser")
public class SystemRoleUserController {

    /**
     * 系统用户角色服务
     */
    private final SysRoleUserService sysRoleUserService;


    /**
     * 保存角色用户
     *
     * @param roleUser 角色菜单
     * @return {@link Result}<{@link Boolean}>
     */
    @PostMapping()
    public Result<Boolean> saveRoleUser(@Validated @RequestBody NmSystemRoleUser roleUser){
        sysRoleUserService.saveRoleUser(roleUser);
        return ResultUtil.success();
    }


}
